package com.example.mountainwalker.service.impl;

import com.example.mountainwalker.entity.UserFollowInfo;
import com.example.mountainwalker.mapper.UserFollowMapper;
import com.example.mountainwalker.service.UserFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserFollowServiceImpl implements UserFollowService {
    @Autowired
    private UserFollowMapper userFollowMapper;

    @Override
    public List<UserFollowInfo> getUserFollowList() {
        return userFollowMapper.getUserFollowList();
    }

    @Override
    public List<UserFollowInfo> getUserFollowListByCondition(String username, String followedUsername,
                                                             Date startTime, Date endTime) {
        return userFollowMapper.getUserFollowListByCondition(username, followedUsername, startTime, endTime);
    }

    @Override
    public UserFollowInfo getUserFollowById(Integer id) {
        return userFollowMapper.getUserFollowById(id);
    }

    @Override
    public int deleteUserFollowById(Integer id) {
        return userFollowMapper.deleteUserFollowById(id);
    }

    @Override
    public int batchDeleteUserFollow(List<Integer> ids) {
        return userFollowMapper.batchDeleteUserFollow(ids);
    }

    @Override
    public int addUserFollow(UserFollowInfo userFollowInfo) {
        return userFollowMapper.addUserFollow(userFollowInfo);
    }

    @Override
    public int updateUserFollow(UserFollowInfo userFollowInfo) {
        return userFollowMapper.updateUserFollow(userFollowInfo);
    }
}